package com.example.recipesapp.data

import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey

// 步骤实体
@Entity(
    tableName = "steps",
    indices = [Index("recipeId")],
    foreignKeys = [ForeignKey(
        entity = Recipe::class,
        parentColumns = ["id"],
        childColumns = ["recipeId"],
        onDelete = ForeignKey.CASCADE
    )]
)
data class Step(
    @PrimaryKey(autoGenerate = true) val id: Long = 0,
    val recipeId: Long,     // 关联主键
    val stepNumber: Int,    // 步骤序号
    val description: String,    // 步骤说明
    val imagePath: String   // 步骤图路径
)
